<div class="title"><span>我的收藏</span></div>
<form action="<!--{iCMS:router url='/user'}-->" method="post" target="iCMS_FRAME">
    <input name="action" type="hidden" value="manage" />
    <input name="pg" type="hidden" value="favorite" />
    <div class="favorite">
      <table class="table table-striped">
        <thead>
          <tr>
            <th>#</th>
            <th>标题</th>
            <th>收藏夹</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <!--{iCMS:favorite:list page="true" userid="$user.uid"}-->
		  <!--{iCMS:favorite:data loop="true" page="true" row="10" userid="$user.uid" fid="$favorite.fid" total_cache="G"}-->
          <tr id="id-<!--{$favorite_data.id}-->">
            <td><!--{$favorite_data.id}--></td>
            <td><a href="<!--{$favorite_data.url}-->" target="_blank"><!--{$favorite_data.title}--></a></td>
            <td><a href="<!--{$favorite.manage}-->fid=<!--{$favorite_data.fid}-->"><!--{$favorite_list[$favorite_data.fid].title}--></a></td>
            <td class="action">
              <a href="javascript:;" class="tip ml10" data-id="<!--{$favorite_data.id}-->" data-action="delete" title="彻底删除"><i class="fa fa-trash-o"></i></a>
            </td>
          </tr>
          <!--{/iCMS}-->
        </tbody>
        <tfoot>
          <tr>
            <td colspan="5"><div class="iCMS_pagination"><!--{$iCMS.PAGE.NAV}--></div></td>
          </tr>
        </tfoot>
      </table>
    </div>
  </form>
  <script type="text/javascript">
$(function(){
	$("[data-action]").on('click',function(event) {
		event.preventDefault();
		var param = {
			'id':$(this).attr("data-id"),
			'act':$(this).attr("data-action"),
			'pg':'favorite','action':'manage'
		}
		$.post("<!--{iCMS:router url='/user'}-->",param,function(c) {
			if (c.code) {
				$("#id-"+param.id).hide('500',function() {
					$(this).remove();
				});
			}else{
				iCMS.alert(c.msg);
			}
		},'json');
	});
});
</script>
